package com.kantboot.db.common.controller;

import com.kantboot.db.common.dto.CreateDatabaseDTO;
import com.kantboot.db.common.service.IDbCommonService;
import com.kantboot.util.common.RestResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/kantboot/db-common")
public class DbCommonController{

    @Resource
    IDbCommonService dbCommonService;

    @RequestMapping("/code-generator")
    public RestResult<String> createJavaCode(@RequestBody CreateDatabaseDTO createDatabaseDTO) {
        dbCommonService.toGenerator(createDatabaseDTO);
        return RestResult.success("SUCCESS", "生成成功");
    }

}
